/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.core.api.model;

import org.proteusframework.core.api.config.IConfigProperty;

import java.util.Collection;

/**
 * Describes a specific <code>IVersion</code> of a specific plugin defined by <code>INamespace</code>.
 * <p/>
 * <code>IVersionDescriptor</code> instances are used extensively by Proteus applications. The version descriptor is
 * how an application dynamically bounds to an registrar factory when attempting to load a specific type of plugin.
 *
 * @author Tacoma Four
 */
public interface IVersionDescriptor
{
    /**
     * Target version number.
     *
     * @return Version data
     */
    IVersion getVersion();

    /**
     * Target qualified name.
     *
     * @return Qualified name
     */
    INamespace getNamespace();

    /**
     * Collection of configuration properties used to refine how the instantiated plugin is defined. For example,
     * asking for Version 1 of a plugin is possible, there may not be a Version 1 that supports the configuration
     * property 'mimeType' of 'application/octet-stream' in the registrar.
     *
     * @return Non-null collection of configuration properties that further decorate the version
     */
    Collection<IConfigProperty> configurationProperties();
}
